{%extends file="user/page/layout.tpl"%}

{%block name="sub-head-static"%}
    {%require name="user:static/buydemand/buydemand.less"%}
    {%require name="user:static/buydemand/buydemand.js"%}
    <script>
        P.data('data',{%json_encode($data)%});
    </script>
{%/block%}

{%block name="right-content"%}
<div class="page-buydemand">

    <div class="block assets-block">
        <div class="title">活期购买</div>
        <div>
            <div class="left">
                <div class="year-profit">{%($data.compound_year_rate*100)|format_amount%}{%if !$data.additional%}%{%/if%}{%if $data.additional%}<span>+{%($data.additional*100)|format_amount%}%</span>{%/if%}</div>
                <span>今日年化收益率</span>
            </div>

            <div class="right">
                <div class="number-block">
                    <i class="ob-icon bo-icon-cycle2"></i>
                    <div class="ob-context">
                        <div class="ob-title ob-title1 now-profit">￥{%$data.plat_credit_buy|format_amount:0%}</div>
                        <div class="ob-info">当前可购买份额</div>
                    </div>
                </div>

                <div class="number-block">
                    <i class="ob-icon bo-icon-cycle2"></i>
                    <div class="ob-context">
                        <div class="ob-title ob-title1 now-profit"><span style="color:#03b6f8;font-size:20px">￥{%$data.available_amount|format_amount:0%}</span>/￥{%$data.limit_buy|format_amount:0%}</div>
                        <div class="ob-info">您的剩余可购份额/购买上限</div>
                    </div>
                </div>
            </div>
            <div class="clear"></div>
        </div>
    </div>

    <div class="block buy-block">
        <div class="line">
            <span class="second-title">账户可用余额：</span>
            <span class="money">￥{%$data.amount|format_amount:2%}</span>
            <a href="/user/recharge" class="text-link">充值</a>
        </div>
        {%if $data.coupon.doing.amount != null%}
        <div class="coupon-block">
            <div class="left">
                <span class="use_icon"></span>
            </div>
            <div class="right">
                <div class="line">使用<span class="red">“我的红包”</span></div>
                <div class="line">
                    <input type="checkbox" class="use_coupon" data="{%$data.coupon.doing.amount%}">
                    {%$data.coupon.doing.desc_type%}
                    <span class="red">￥{%$data.coupon.doing.amount%}</span>
                    （有效期：{%$data.coupon.doing.period_validity%}）
                </div>
                <div class="line coupon_info">小提示：无论支付金额多少，此红包仅可使用一次。</div>
            </div>
            <div class="clear"></div>
        </div>
        {%/if%}
        <div class="line">
            <div class="money-input">
                <span>￥</span>
                <input type="text" class="amount" placeholder="请输入购买金额">
            </div>
        </div>
        <div class="buy_confirm">
            <div class="line">
                实际支付金额：<span class="value">￥230.153</span>
            </div>
            <div class="line">
                {%if $data.plat_credit_buy>=1%}
                <button class="btn btn-large btn-main btn-buy">购买</button>
                {%else%}
                <button class="btn btn-large btn-disable">已售完</button>
                {%/if%}
            </div>
        </div>
    </div>

    <div class="block tip-block">
        <h5>温馨提示：</h5>
        <p>1、每日11:00增加可购份额，当有用户赎回时，可购份额也会实时增加。</p>
        <p>2、活期购买成功后，当日即可获得收益，次日显示在我的收益中。</p>
        <p>3、真融宝活期会将您昨日产生的收益转为本金，进行自动复投，实现循环式的增值。</p>
        <p>4、真融宝活期金额可随时赎回到我的帐户。</p>
        <!--<p>5、目前每个新注册用户有10000元活期购买额度。您可通过参与活动提高活期额度，每人最高上限50000元。若您想提高额度，请至“我的帐户”页面上方，用微信扫描二维码，参与活动。</p>-->
    </div>
</div>
{%/block%}
